package fr.afcepf.atod18.hotels.managedbeans;


import java.util.List;

import javax.faces.bean.SessionScoped;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import fr.afcepf.atod18.hotels.dao.interfaces.IChambreDAO;
import fr.afcepf.atod18.hotels.dao.interfaces.IHotelDAO;
import fr.afcepf.atod18.hotels.dao.interfaces.IPaysDAO;
import fr.afcepf.atod18.hotels.entities.CapaciteChambre;
import fr.afcepf.atod18.hotels.entities.Chambre;
import fr.afcepf.atod18.hotels.entities.ChambreId;
import fr.afcepf.atod18.hotels.entities.Hotel;
import fr.afcepf.atod18.hotels.entities.Optionhotel;
import fr.afcepf.atod18.hotels.entities.Pays;

@SessionScoped
@Component
@Transactional
public class TestManagedBean {
	
	@Autowired
	private IChambreDAO dao;
	
	private Pays vuePays = new Pays();
    private Hotel vueHotel = new Hotel();
    
	public String insertpays() {
		if (dao != null) {
			System.out.println("TestManagedBean: insertpays() acces hotel");
			ChambreId idCh = new ChambreId();
			idCh.setHoteldHotel(1);
			idCh.setNumero(1);
			Chambre  ch = dao.findById(idCh);
			System.out.println(ch);
		}
		else
			System.out.println("TestManagedBean: insertpays() injection null");
		return "";
	}

	public IChambreDAO getDao() {
		return dao;
	}

	public void setDao(IChambreDAO dao) {
		this.dao = dao;
	}

	public Pays getVuePays() {
		return vuePays;
	}

	public void setVuePays(Pays vuePays) {
		this.vuePays = vuePays;
	}

	public Hotel getVueHotel() {
		return vueHotel;
	}

	public void setVueHotel(Hotel vueHotel) {
		this.vueHotel = vueHotel;
	}
}
